import Vue from 'vue'
import VueRouter from "vue-router";
import LayOut from '@/views/layout'
import Collect from '@/views/collect'
import Article from '@/views/article'
import Like from '@/views/like'
import User from '@/views/user'
import Detail from '../views/article-detail.vue'
Vue.use(VueRouter)
const router = new VueRouter({
  routes: [
    {
      path:'/',
      redirect: '/layout',
  },
    { name:'LayOut',
      path: '/layout',
      component: LayOut,
      children: [
        { 
          path: '/article',
          component:Article
        },
        { name:'Article',
        path: '/article',                                              
        component:Article
        },
        { name:'Collect',
        path: '/collect',
        component:Collect
        },
        { name:'Like',
        path: '/like',
        component:Like
        },
        { name:'User',
        path: '/user',
        component:User
        },
        /* 动态id :id */
        {
     /*    path: '/detail/:id', */
        path: '/detail',
        component:Detail
      },
      ]
    }
  ]
})

export default router